namespace SolidMvvm {
	using System;
	using System.Globalization;
	using System.Windows.Data;

	/// <summary>
	/// </summary>
	[ValueConversion(typeof(byte[]), typeof(string))]
	public class ByteArrayToReverseHexStringConverter : IValueConverter {
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
			return value == null ? string.Empty : Conversions.ByteArrayToHexString(Conversions.GetNewReversedArray((byte[])value));
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
			return value == null ? null : Conversions.GetNewReversedArray(Conversions.HexStringToByteArray((string)value));
		}
	}
}
